package com.edu.atguigu.spring5.textAOP;/*
@author joker
@create 2022-03-23 21:53
Spring_atguigu02
*/

import com.edu.atguigu.spring5.aopanno.User;
import com.edu.atguigu.spring5.aopxml.Book;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAop {
    @Test
    public void testAop() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanAOP1.xml");
        User user = context.getBean("user", User.class);
        user.add();
    }

    @Test
    public void testAop2() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beanAOP2.xml");
        Book book = context.getBean("book", Book.class);
        book.buy();
    }
}
